//
//  CustomTools.h
//  LXTong
//
//  Created by Darin4lin on 16/7/5.
//  Copyright © 2016年 QZBD. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
//#import <CommonCrypto/CommonCryptor.h>
#import <sys/utsname.h>

@interface CustomTools : NSObject

+(UIImage*) createImageWithColor: (UIColor*) color;
+(UIViewController *)getCurrentVC;
+(void)readNumberOfCompassWithLabel:(UILabel*)label andImageView:(UIImageView*)imageView andValue:(CGFloat)value;
+(NSString*)changedFloatToStringWithFloatValue:(double)value andName:(NSString*)name;
+(CGFloat)widthOfString:(NSString *)string font:(UIFont *)font height:(CGFloat)height;
+(void)restoreRootViewController:(UIViewController *)rootViewController;
+(NSString *)formatDataWithTTY:(NSString *)string;
+(NSString *)compareDate:(NSDate *)date;
+(NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+(void)registerLocalNotification:(NSString *)string;
+(NSString *)getUUID;
//对盒子密码加密
+(NSString*)BoxPasswordWithOrigalPassword:(NSString*)password;//--
+(NSString*)getCurrentTime;
+(NSArray*)getPassArrayFromString:(NSString *)string;
+(NSArray*)getPasswordFactor:(NSString*)time;
+(NSString *)toBinarySystemWithDecimalSystem:(NSString *)decimal Change:(BOOL)isChange GetLow:(BOOL)isLow;
// 二进制转十进制
+(NSString*)OtherToDecimalSystemWithBinarySystem:(NSString *)binary;

/**
 计算校验和
 */
+(NSString*)getSumByHex:(NSString*)hex;//--
+(NSData*)dataWithHexstring:(NSString *)hexstring;
// 将传入的NSData类型转换成NSString并返回
+(NSString*)hexadecimalString:(NSData *)data;//--
+ (NSData *)DESDecrypt:(NSString *)cipherText WithKey:(NSString *)key;
/**
 *  普通字符串(ASII)转换为十六进制的
 *
 *  @param string 普通字符串(ASII)
 *
 *  @return 十六进制
 */
+ (NSString *)hexStringFromString:(NSString *)string;//--
//十六进制转换为普通字符串(ASII)
+ (NSString *)stringFromHexString:(NSString *)hexString;//--
//十六进制转换为普通字符串
+(NSString *)hexTurnString:(NSString *)hexString;
//将汉字字符串转换成16进制字符串
+ (NSString*)chineseToHex:(NSString*)chineseStr;
// ascii 转字符串
+(NSString *)asciiToString:(NSString *)ASCII;
+ (NSString*)NSDataToByteTohex:(NSData *)data;//
+(int)isChineseCharacterAndLettersAndNumbersAndUnderScore:(NSString *)string andMaxLength:(int)maxLength;
//将16进制字符串转换成汉字字符串
+(NSString*)changeLanguage:(NSString*)chinese;
+(double)changedStringToDouble:(NSString*)string;
+(NSString*)weekdayStringFromDate:(NSDate*)inputDate;
// 返回两个经纬度之间的距离，单位是 米
+(double)distanceBetweenOrderBy:(double) lat1 :(double) lat2 :(double) lng1 :(double) lng2;
/**
 des加密

 @param NSString 未加密文本
 @return 密文
 */
+ (NSString *) encryptUseDES:(NSString *)plainText key:(NSString *)key;

/**
 des解密

 @param cipherText 密文
 @param key 加密key
 @return 明文
 */
+ (NSString *) decryptUseDES:(NSString*)cipherText key:(NSString*)key;
+ (NSString *)iphoneType;

+ (UIImage *)makeCircularImageWithImage:(UIImage *)image size:(CGSize)size radius:(CGFloat)radius hasBorder:(Boolean)hasBorder;
+(NSString *)subString:(NSString *)text length:(NSInteger)length;
@end
